package org.dromara.event.domain.vo;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.event.domain.ChatMessage;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;



/**
 * 聊天消息（按群组分区存储）视图对象 chat_message
 *
 * @author 吴俊杰
 * @date 2025-04-24
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ChatMessage.class)
public class ChatMessageVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 消息ID（自增主键）
     */
    @ExcelProperty(value = "消息ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "自=增主键")
    private Long messageId;

    /**
     * 所属群组ID（外键关联chat_group.group_id）
     */
    @ExcelProperty(value = "所属群组ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "外=键关联chat_group.group_id")
    private Long groupId;

    /**
     * 发送者ID（外键关联sys_user.user_id）
     */
    @ExcelProperty(value = "发送者ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "外=键关联sys_user.user_id")
    private Long senderId;

    /**
     * 消息内容（支持文本/JSON格式，可存储富媒体信息）
     */
    @ExcelProperty(value = "消息内容", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "支=持文本/JSON格式，可存储富媒体信息")
    private String content;

    /**
     * 消息类型（text:文本/image:图片/file:文件）
     */
    @ExcelProperty(value = "消息类型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "t=ext:文本/image:图片/file:文件")
    private String messageType;

    /**
     * 发送时间（用于消息排序）
     */
    @ExcelProperty(value = "发送时间", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "用=于消息排序")
    private Date sendTime;

    /**
     * 是否是本人发送
     */
    private String isSelf;

    /**
     * 用户头像
     */
    private String UsrAvatar;

    /**
     * 用户名
     */
    private String username;



}
